<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>岗位管理</title>
	<meta name="description" content="这是一个 index 页面">
	<meta name="keywords" content="index">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="renderer" content="webkit">
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="icon" type="image/png" href="${ctx}/assets/i/favicon.png">
	<link rel="apple-touch-icon-precomposed" href="${ctx}/assets/i/app-icon72x72@2x.png">
	<meta name="apple-mobile-web-app-title" content="Amaze UI" />
	<link rel="stylesheet" href="${ctx}/assets/css/amazeui.datatables.min.css" />
	<script src="${ctx}/assets/js/echarts.min.js"></script>
	<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.7.2/css/amazeui.min.css" />
	<script src="https://cdn.bootcss.com/jquery/2.2.3/jquery.js"></script>
	<link rel="stylesheet" href="${ctx}/assets/css/app.css">
</head>

<body data-type="widgets">
	<script src="${ctx}/assets/js/theme.js"></script>
	<%@ include file="../../jspf/adminheader.jspf"%>
		<div class="am-g tpl-g" >
			<!-- 内容区域 -->
			<div class="row-content" style="margin-left:240px;">
			<div class="row-content am-cf" style="height:800px;">
				<div class="row">
					<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
						<div class="widget am-cf">
							<div class="widget-head am-cf">
								<div class="widget-title  am-cf">岗位管理</div>
							</div>
							<div class="widget-body  am-fr">
								<div class="am-u-sm-12">
									<table id="example"
										class="am-table am-table-compact am-table-striped tpl-table-black">
										<thead>
											<tr>
												<th>id</th>
												<th>flag</th>
												<th>岗位名称</th>
												<th>岗位描述</th>
												<th>操作</th>
											</tr>
										</thead>
										<tfoot>
											<tr>
												<th>id</th>
												<th>flag</th>
												<th>岗位名称</th>
												<th>岗位描述</th>
												<th>操作</th>
											</tr>
										</tfoot>
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.min.js"></script>
	<script src="${ctx}/assets/js/amazeui.datatables.min.js"></script>
	<script src="${ctx}/assets/js/dataTables.responsive.min.js"></script>
	<script src="${ctx}/assets/js/app.js"></script>

	<script type="text/javascript">
		$(document).ready(function() {
			$('#example').dataTable({
				"processing" : true,
				"serverSide" : true,
				"ajax" : {
					"type" : "POST",
					"url" : "getData",
					"data" : {},
				},
				scorlly:500,
				 "columns": [ //表格要显示的列定义(字段名称做了处理)
	                    { "data": "id", "visible":false },
	                    { "data": "flag", "visible":false },
	                    { "data": "name","width":"15%" },
	                    { "data": "desc" },
	                    //其余字段定义省略
	            ],
	            "aaSorting": [ //指定排序的列（索引从0开始）及规则
                   [2, "desc" ]
                 ],
	          //自定义字段
				columnDefs:[
					{
                    	targets: 4,
                    	render: function (data, type, row, meta) {
                    		var str ='';
                    		if(row.flag){
                    			return '<a class="am-btn am-icon-pencil" href="update?id='+ row.id + '">修改</a>'
            						+ '<a class="am-btn am-icon-trash" href="use?id='+ row.id + '">删除</a>';
                    		}
                    		else{
                    			return '<a class="am-btn am-icon-pencil" href="#">修改</a>'
        							+ '<a class="am-btn am-icon-trash" href="use?id='+ row.id + '">恢复</a>';
                    		}
	                    }
	                },
	                { "orderable": false, "targets": 4 }
	            ]
			});
		})
	</script>
</body>

</html>